<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>
<link href="${ctx.resource}/css/select2.css" rel="stylesheet">
<link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet">
<title>修改密码 - 租房宝金融管理平台</title>
</head>
<body>

	<%@ include file="/WEB-INF/include/header.jsp"%>

	<div class="web-g-main">
	<%@ include file="/WEB-INF/include/aside.jsp"%>
		<div class="content">
		<header class="header clearfix">
			<h4 class="pull-left">邮件发送</h4>
		</header>
			<form class="form-horizontal" role="form" data-validate="true">
	         <div class="input-group col-md-2">
	         	<span class="input-group-addon">商户</span>
	         	    <select id = "app" name="app" class="form-control" required="required">
		              <option value=""></option>
		              <c:forEach var="item" items="${appList}">
		                <option value="${item.id }" <c:if test="${item.id eq app }">selected</c:if>>${item.name }</option>
		              </c:forEach>
		            </select>
	         </div>
	         <div class="input-group" style="margin-top:10px;">
				<button id="sendEmail" class="btn btn-default btn-shadow btn-shadow-default form-control" title="发送邮件"><i></i>&nbsp;&nbsp;发送日报</button>
			</div>
			</form>
			<%@ include file="/WEB-INF/include/footer.jsp"%>
		</div>
	</div>
	<%@ include file="/WEB-INF/include/script.jsp"%>
	<script src="${ctx.resource}/js/bootstrap-switch.min.js"></script>
	<script src="${ctx.resource}/js/bootstrap-modal-trigger.js"></script>
	<script src="${ctx.resource}/js/bootstrap.validate.js"></script>
	<script src="${ctx.resource}/js/bootstrap.validate.en.js"></script>
	<script src="${ctx.resource}/js/bootstrap-alert-fade-trigger.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#sendEmail").click(function(event) {
				var app = $.trim($("#app").val());
				if (app == "") {
					alert("信息不完整，不能发送");
				}else{
					$.post('${ctx}/send-email', {
						app : app
					}, function(data) {
						alert(data);
						location.reload(true);
					});
				}
				event.preventDefault();
				return false;
			});
		});
	</script>
</body>
</html>